<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>单卡片加载效果优化</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
            color: #fff;
            min-height: 100vh;
            padding: 40px 20px;
            overflow-x: hidden;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        header {
            text-align: center;
            margin-bottom: 50px;
            padding: 20px;
        }
        
        h1 {
            font-size: 3rem;
            margin-bottom: 15px;
            text-shadow: 0 2px 15px rgba(0,0,0,0.3);
            background: linear-gradient(to right, #ff9966, #ff5e62);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 1px;
        }
        
        .subtitle {
            font-size: 1.3rem;
            opacity: 0.9;
            max-width: 700px;
            margin: 0 auto;
            line-height: 1.6;
        }
        
        .content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 35px;
            margin-bottom: 50px;
        }
        
        .card {
            background: rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(8px);
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
            transition: all 0.4s ease;
            position: relative;
            transform: translateY(0);
            height: 420px;
        }
        
        .card:hover {
            transform: translateY(-12px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
        }
        
        .card-header {
            height: 180px;
            position: relative;
            overflow: hidden;
        }
        
        .card-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .card:hover .card-img {
            transform: scale(1.05);
        }
        
        .card-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            padding: 20px;
            background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
        }
        
        .card-title {
            font-size: 1.8rem;
            margin-bottom: 5px;
            font-weight: 600;
        }
        
        .card-subtitle {
            font-size: 1rem;
            opacity: 0.85;
        }
        
        .card-body {
            padding: 25px;
        }
        
        .card-description {
            line-height: 1.7;
            margin-bottom: 25px;
            font-size: 1.05rem;
            opacity: 0.9;
            height: 90px;
            overflow: hidden;
        }
        
        .card-footer {
            display: flex;
            justify-content: space-between;
            padding: 0 25px 25px;
        }
        
        .btn {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            border: none;
            padding: 12px 30px;
            font-size: 1.1rem;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
        }
        
        .btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-3px);
        }
        
        .btn:active {
            transform: translateY(1px);
        }
        
        /* 卡片加载效果 - 修复模糊问题 */
        .card-content {
            position: relative;
            height: 100%;
            transition: filter 0.4s ease;
        }
        
        .card-loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.65);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 20; /* 确保在模糊内容之上 */
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s ease;
            border-radius: 18px;
        }
        
        .card-loading.active {
            opacity: 1;
            visibility: visible;
        }
        
        .loader {
            width: 70px;
            height: 70px;
            position: relative;
            margin-bottom: 20px;
        }
        
        .loader-inner {
            position: absolute;
            width: 100%;
            height: 100%;
            border: 4px solid transparent;
            border-top-color: #3498db;
            border-radius: 50%;
            animation: spin 1.5s linear infinite;
        }
        
        .loader-inner:nth-child(2) {
            border-top-color: #e74c3c;
            animation-delay: 0.2s;
        }
        
        .loader-inner:nth-child(3) {
            border-top-color: #2ecc71;
            animation-delay: 0.4s;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            color: white;
            font-size: 1.3rem;
            letter-spacing: 1px;
            font-weight: 300;
            text-align: center;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .card-content.blur-effect {
            filter: blur(4px);
        }
        
        .instructions {
            max-width: 800px;
            margin: 50px auto 30px;
            background: rgba(0, 0, 0, 0.2);
            padding: 25px;
            border-radius: 15px;
            border-left: 4px solid #4CAF50;
        }
        
        .instructions h2 {
            font-size: 1.8rem;
            margin-bottom: 15px;
            color: #4CAF50;
        }
        
        .instructions p {
            line-height: 1.8;
            font-size: 1.1rem;
            margin-bottom: 10px;
        }
        
        .instructions ul {
            padding-left: 25px;
            margin: 15px 0;
        }
        
        .instructions li {
            margin-bottom: 10px;
            line-height: 1.6;
        }
        
        .feature-badge {
            display: inline-block;
            background: rgba(76, 175, 80, 0.3);
            color: #fff;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.9rem;
            margin-right: 8px;
        }
        
        footer {
            text-align: center;
            padding: 30px;
            margin-top: 20px;
            opacity: 0.8;
            font-size: 1rem;
            border-top: 1px solid rgba(255,255,255,0.1);
        }
        
        .card-stats {
            display: flex;
            justify-content: space-around;
            padding: 15px 25px;
            background: rgba(0,0,0,0.1);
            border-top: 1px solid rgba(255,255,255,0.05);
        }
        
        .stat-item {
            text-align: center;
        }
        
        .stat-value {
            font-size: 1.3rem;
            font-weight: 600;
            color: #ffcc00;
        }
        
        .stat-label {
            font-size: 0.9rem;
            opacity: 0.8;
        }
        
        @media (max-width: 768px) {
            .content {
                grid-template-columns: 1fr;
            }
            
            h1 {
                font-size: 2.3rem;
            }
            
            .subtitle {
                font-size: 1.1rem;
            }
            
            .card-footer {
                flex-direction: column;
                gap: 15px;
            }
            
            .btn {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1><i class="fas fa-sync-alt"></i> 单卡片加载效果优化版</h1>
            <p class="subtitle">修复了加载文字模糊问题, 优化了视觉效果, 每个卡片独立加载不影响其他内容</p>
        </header>
        
        <div class="content">
            <!-- 卡片 1 -->
            <div class="card">
                <div class="card-content">
                    <div class="card-header">
                        <img src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="山脉" class="card-img">
                        <div class="card-overlay">
                            <h2 class="card-title">自然风光</h2>
                            <p class="card-subtitle">探索世界壮丽景色</p>
                        </div>
                    </div>
                    
                    <div class="card-body">
                        <p class="card-description">山脉、森林、湖泊和海洋构成了地球最美丽的自然景观。这些自然奇观不仅令人叹为观止, 还为各种野生动植物提供了栖息地。</p>
                    </div>
                    
                    <div class="card-stats">
                        <div class="stat-item">
                            <div class="stat-value">4.8</div>
                            <div class="stat-label">评分</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">128</div>
                            <div class="stat-label">照片</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">24</div>
                            <div class="stat-label">地点</div>
                        </div>
                    </div>
                    
                    <div class="card-footer">
                        <button class="btn card-load-btn" data-card="1">
                            <i class="fas fa-eye"></i> 查看详情
                        </button>
                        <button class="btn card-action-btn" data-card="1">
                            <i class="fas fa-sync-alt"></i> 加载内容
                        </button>
                    </div>
                </div>
                
                <div class="card-loading">
                    <div class="loader">
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                    </div>
                    <div class="loading-text">正在加载数据...</div>
                </div>
            </div>
            
            <!-- 卡片 2 -->
            <div class="card">
                <div class="card-content">
                    <div class="card-header">
                        <img src="https://images.unsplash.com/photo-1470229722913-7c0e2dbbafd3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="音乐会" class="card-img">
                        <div class="card-overlay">
                            <h2 class="card-title">音乐盛会</h2>
                            <p class="card-subtitle">沉浸式音乐体验</p>
                        </div>
                    </div>
                    
                    <div class="card-body">
                        <p class="card-description">现场音乐会能带来无与伦比的体验, 艺术家与观众之间的能量交流创造难忘时刻。从摇滚到古典, 各种音乐类型都能触动人心。</p>
                    </div>
                    
                    <div class="card-stats">
                        <div class="stat-item">
                            <div class="stat-value">4.9</div>
                            <div class="stat-label">评分</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">56</div>
                            <div class="stat-label">活动</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">12</div>
                            <div class="stat-label">艺术家</div>
                        </div>
                    </div>
                    
                    <div class="card-footer">
                        <button class="btn card-load-btn" data-card="2">
                            <i class="fas fa-eye"></i> 查看详情
                        </button>
                        <button class="btn card-action-btn" data-card="2">
                            <i class="fas fa-sync-alt"></i> 加载内容
                        </button>
                    </div>
                </div>
                
                <div class="card-loading">
                    <div class="loader">
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                    </div>
                    <div class="loading-text">处理请求中...</div>
                </div>
            </div>
            
            <!-- 卡片 3 -->
            <div class="card">
                <div class="card-content">
                    <div class="card-header">
                        <img src="https://images.unsplash.com/photo-1534438327276-14e5300c3a48?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="科技" class="card-img">
                        <div class="card-overlay">
                            <h2 class="card-title">科技创新</h2>
                            <p class="card-subtitle">未来科技前沿</p>
                        </div>
                    </div>
                    
                    <div class="card-body">
                        <p class="card-description">人工智能、量子计算和生物技术正在重塑我们的世界。这些突破性技术不仅改变行业, 也重新定义了我们生活、工作和娱乐的方式。</p>
                    </div>
                    
                    <div class="card-stats">
                        <div class="stat-item">
                            <div class="stat-value">4.7</div>
                            <div class="stat-label">评分</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">89</div>
                            <div class="stat-label">技术</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">32</div>
                            <div class="stat-label">创新</div>
                        </div>
                    </div>
                    
                    <div class="card-footer">
                        <button class="btn card-load-btn" data-card="3">
                            <i class="fas fa-eye"></i> 查看详情
                        </button>
                        <button class="btn card-action-btn" data-card="3">
                            <i class="fas fa-sync-alt"></i> 加载内容
                        </button>
                    </div>
                </div>
                
                <div class="card-loading">
                    <div class="loader">
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                        <div class="loader-inner"></div>
                    </div>
                    <div class="loading-text">获取信息中...</div>
                </div>
            </div>
        </div>
        
        <div class="instructions">
            <h2><i class="fas fa-check-circle"></i> 优化说明</h2>
            <p>此版本解决了加载文字模糊问题, 并进行了多项优化：</p>
            <ul>
                <li><span class="feature-badge">修复</span> <strong>文字模糊问题</strong>：加载层与内容分离, 确保文字清晰显示</li>
                <li><span class="feature-badge">优化</span> <strong>层级结构</strong>：加载层位于内容之上, 不受模糊效果影响</li>
                <li><span class="feature-badge">新增</span> <strong>数据统计区域</strong>：展示卡片相关信息</li>
                <li><span class="feature-badge">改进</span> <strong>视觉设计</strong>：更精美的卡片布局和加载动画</li>
                <li><span class="feature-badge">增强</span> <strong>交互体验</strong>：按钮状态反馈更明确</li>
            </ul>
            <p>点击任意卡片的"加载内容"按钮体验效果。加载过程持续3秒（模拟实际场景）。</p>
        </div>
        
        <footer>
            <p>单卡片加载效果优化版 | CSS高级技巧 | 2023年设计</p>
        </footer>
    </div>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 获取所有卡片操作按钮
            const actionButtons = document.querySelectorAll('.card-action-btn');
            
            // 为每个按钮添加点击事件
            actionButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const cardId = this.getAttribute('data-card');
                    const card = this.closest('.card');
                    const cardContent = card.querySelector('.card-content');
                    const loadingElement = card.querySelector('.card-loading');
                    
                    // 应用模糊效果到内容区域（不包括加载层）
                    cardContent.classList.add('blur-effect');
                    
                    // 显示加载动画
                    loadingElement.classList.add('active');
                    
                    // 禁用按钮
                    this.disabled = true;
                    this.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
                    
                    // 模拟加载过程（3秒）
                    setTimeout(() => {
                        // 移除模糊效果
                        cardContent.classList.remove('blur-effect');
                        
                        // 隐藏加载动画
                        loadingElement.classList.remove('active');
                        
                        // 恢复按钮状态
                        this.disabled = false;
                        this.innerHTML = '<i class="fas fa-sync-alt"></i> 重新加载';
                        
                        // 更新卡片内容
                        const description = card.querySelector('.card-description');
                        description.innerHTML = description.innerHTML + " <strong style='color:#4CAF50;'>(已加载更多内容!)</strong>";
                        
                        // 显示成功提示
                        const statValue = card.querySelector('.stat-value');
                        if(statValue) {
                            const newValue = parseInt(statValue.textContent) + 1;
                            statValue.textContent = newValue;
                        }
                    }, 3000);
                });
            });
            
            // 为"查看详情"按钮添加简单效果
            const viewButtons = document.querySelectorAll('.card-load-btn');
            viewButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const cardId = this.getAttribute('data-card');
                    alert(`您点击了卡片 ${cardId} 的查看详情按钮`);
                });
            });
        });
    </script>
</body>
</html>